package com.ssy.lingxi.member.merchant.model.vo.basic.response;

import com.ssy.lingxi.member.merchant.utils.NumberUtil;
import org.springframework.util.StringUtils;

import java.io.Serializable;
import java.util.Objects;

/**
 * 等级及等级名称VO
 * @author 万宁
 * @version 2.0.0
 * @date 2020-08-27
 */
public class LevelAndTagVO implements Serializable {
    private static final long serialVersionUID = -7043933308860923837L;

    public LevelAndTagVO() {
    }

    public LevelAndTagVO(Integer level, String levelTag) {
        this.level = NumberUtil.isNullOrZero(level) ? 0 : level;
        this.levelTag = StringUtils.hasLength(levelTag) ? levelTag : "";
    }

    /**
     * 等级
     */
    private Integer level;

    /**
     * 等级名称
     */
    private String levelTag;

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public String getLevelTag() {
        return levelTag;
    }

    public void setLevelTag(String levelTag) {
        this.levelTag = levelTag;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        LevelAndTagVO tagVO = (LevelAndTagVO) o;
        return level.equals(tagVO.level);
    }

    @Override
    public int hashCode() {
        return Objects.hash(level);
    }
}
